﻿using System;
using System.Collections.Generic;
using Color = System.Drawing.Color;
using SwinGame;
using System.Diagnostics;

namespace Jumpman.src
{
    public class GravityAction : IAction
    {
        private const int MAX_VELOCITY = 10;
        private const float ACCELERATION = 0.5f;

        public void DoAction(GameController gc)
        {

            foreach (GameElement gE in gc.CurrentStage.ListOfGameElements)
            {


                if (gE.IsFalling && gE.ElementSprite.Velocity.Y <= MAX_VELOCITY)
                {



                    gE.ElementSprite.Velocity.Y += ACCELERATION;

                }




            }

        }
    }
}
